<html>
<head>
<title>iPlayer MCE</title>

  <link rel="STYLESHEET" type="text/css" href="Main.css"></link>

<script src="BasicFunctions.js" type="text/javascript"></script>
<script src="MoveFocus.js" type="text/javascript"></script>
<script language="JScript" id="clientEventHandlersJS">


  function gup( name )
  {
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp( regexS );
  var results = regex.exec( window.location.href );
  if( results == null )
  return "";
  else
  return unescape(results[1]);
  }

  function pageLoadFunctions()
  {
  var playerId=gup("id");
  var programName=gup("title");
  var episodeName=gup("episode");
  var BBC_UID=gup("BBC_UID");
  var embedString="<embed  MCFocusable=\"true\" type=\"application/x-shockwave-flash\" src=\"iplayer-external.swf\" style=\"\" id=\"emp\" name=\"emp\" bgcolor=\"#000000\" quality=\"high\" allowfullscreen=\"true\" flashvars=\"config=http://www.bbc.co.uk/iplayer/emp/xml/config.xml&amp;metafile=http://www.bbc.co.uk/iplayer/metafiles/episode/"+playerId+".xml&amp;debug=false&amp;bbc_uid="+BBC_UID+"\" height=\"420\" width=\"643\" />";
    var emp=document.createElement(embedString);
    titleSpan.innerHTML = programName;
    playerSpan.appendChild(emp);
    episodeDetails.innerHTML = episodeName;
    downloadLink.innerHTML="<a href=\"http://www.bbc.co.uk/iplayer/page/item/"+playerId+".shtml\"><img border=0 src=\"download.jpg\"></a>";
    setBGColor("#000000");
    setArray();
    startFocus();
    emp.focus();
    }


    function doSelect()
    {
      emp.focus();
    }


  </script>
</head>

<body id="body" MCFocusStart="titleSpan" onload="pageLoadFunctions()" onkeydown="onRemoteEvent(window.event.keyCode)">
<bgsound id="btnSound" />

<!-- Page Title -->
<span class="Text1" style="position: absolute; top: 40; left: 120; width: 612;" id="titleSpan" MCFocusable="true">
    <strong>Play Media</strong>
</span>
<span id="downloadLink" style="position: absolute; top: 40; right: 20;" ></span>

<!-- Table for media description, etc. -->
<table border="0" style="position: absolute; top: 97; left: 120; width: 95%;" cellpadding="0" cellspacing="3" id="mediaTable">
    <tr>
      <td>
        <span id="playerSpan" ></span>
    </td>
<td class="Text1"><strong>Remote Control Instructions</strong><br/>Press OK twice to enter full screen<br/>Press Clear to exit full screen</td>
    </tr>
    <tr>
        <td class="Text1" collspan=2 >
            <strong>
              <span id="episodeDetails">Episode Details</span></strong>
        </td>
    </tr>
</table>

</body>
</html>